package com.yichuang.wuziqi.tool;

import android.graphics.Point;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.parser.Feature;
import com.yichuang.wuziqi.domain.Data;

/**
 * Created by xcm on 17-12-2.
 */

public class JsonTools {
    public static String generateResult(int type, String data) {
        return JSONObject.toJSONString(new Data(type, data));
    }

    public static String toJSONString(Object o) {
        return JSONObject.toJSONString(o);
    }

    public static <T> T toOject(String data, Class<T> clazz) {
        return JSONObject.parseObject(data, clazz);
    }
}
